<!DOCTYPE HTML>
<%@page import="shop.factory.DAOFactory"%>
<%@page import="shop.vo.UserBean"%>
<html>
<head>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<meta charset="UTF-8" />
<link rel="stylesheet" href="../css/bootstrap.min.css">
<script src="../js/jquery-1.10.2.min.js" type="text/javascript"
	charset="utf-8"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<title>会员信息</title>
<style type="text/css">
span {
	color: #C7254E;
}
</style>
</head>
<%
	String username = (String)session.getAttribute("user");
	UserBean user = new UserBean();
	user.setUser_name(username);;
	int userId = DAOFactory.getIUserDAOInstance().findId(user);
	UserBean user1 = DAOFactory.getIUserDAOInstance().find(userId);
%>
<body>
	<nav class="navbar navbar-default" role="navigation">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse"
				data-target="#bs-example-navbar-collapse-1">
				<span class="sr-only">Toggle navigation</span> <span
					class="icon-bar"></span> <span class="icon-bar"></span> <span
					class="icon-bar"></span>
			</button>
		</div>
		<div class="collapse navbar-collapse"
			id="bs-example-navbar-collapse-1">
			<ul class="nav navbar-nav">
				<li class="active"><a href="../index.jsp">首页</a></li>
				<li><a href="<%=request.getContextPath() %>/OrderServlet?action=MyOrder"> <img src="../images/order.png" /> 我的订单
				</a></li>
				<li></li>
				<li><a href="<%=request.getContextPath() %>/OrderServlet?action=MyCart"> <img src="../images/car.png" /> 我的购物车
				</a></li>
				<li><a href="<%=request.getContextPath() %>/FavoriteServlet?action=MyFav"> <img src="../images/favorite.png" /> 我的收藏
				</a></li>
				<li><a href="<%=request.getContextPath() %>/AddressServlet?action=MyAddress"> <img src="../images/address.png" /> 我的地址簿
				</a></li>
			</ul>

			<ul class="nav navbar-nav navbar-right">
				<li><a href="<%=request.getContextPath() %>/UserServlet?action=xinxi"><span id="huanying">欢迎光临，游客</span></a></li>
				<li><a href="./Login/login.jsp">登陆</a></li>
				<li><a href="./Login/regist.jsp">注册</a></li>
				<li><a href="<%=request.getContextPath() %>/UserServlet?action=logout" class="active" onclick="return confirm('确认退出?')">退出</a></li>
			</ul>
		</div>
	</nav>

	<div class="container">
		<h3>会员信息管理</h3>
		<div class="page-header" style="margin-top: 10px;"></div>
			<table class="table table-bordered table-condensed table-striped"> 
				<tr>
					<td align="right">用户名：</td>
					<td><%=user1.getUser_name() %></td>
				</tr>
				<tr>
					<td align="right">会员手机号：</td>
					<td><%=user1.getUser_mobile() %></td>
				</tr>
				<tr>
					<td align="right">家庭电话：</td>
					<td><%=user1.getUser_phone() %></td>
				</tr>
				<tr>
					<td align="right">会员住址：</td>
					<td><%=user1.getUser_addr() %></td>
				</tr>
				<tr>
					<td align="right">性别：</td>
					<td><%=user1.getUser_sex() %></td>
				</tr>
				<tr>
					<td align="right">生日：</td>
					<td><%=user1.getUser_birthday() %></td>
				</tr>
				<tr>
					<td align="right">真实姓名：</td>
					<td><%=user1.getUser_truename() %></td>
				</tr>
				<tr>
					<td align="right">邮政编码：</td>
					<td><%=user1.getUser_zip() %></td>
				</tr>
				<tr>
					<td align="right">注册email：</td>
					<td><%=user1.getUser_email() %></td>
				</tr>
				<tr>
					<td align="center" colspan="2">
					<form action="<%=request.getContextPath() %>/UserServlet?action=xgxx" method="post">
						<input type="submit" value="修改信息">
					</form>
					</td>
				</tr>
			</table>
	</div>
</body>
<script type="text/javascript">
<%
	String str = (String)session.getAttribute("user");
	if (session.getAttribute("user") != null) {
%>
document.getElementById("huanying").innerHTML = "欢迎光临，<%=str%>";
<%
	} else {
%>
document.getElementById("huanying").innerHTML = "欢迎光临，游客";
<%
	}
%>
</script>
</html>